1. Field of the Invention
The present invention relates to an encoding method, and more particularly, to an encoding method for an optical recorder.
2. Description of the Prior Art
In recent years, the use of compact discs (CDs) as a storage medium has risen dramatically. As a result, optical recorders such as CD recordable (CD-R) and CD-rewritable (CD-RW) drives have entered the mainstream electronics market. Through the use of these optical recorders, information can be stored on a CD in different modes, which include audio and data. In addition, CDs can be created that include both audio and data on the same disc.
Typically, data from a host computer is encoded by the optical recorder, and then stored on the CD. According to the Orange Book standard, a CD can be written to in several different formats: track at once (TAO), session at once (SAO), disc at once (DAO), and Packet write. Each track written using TAO can either be an audio track or a data track. On the other hand, SAO allows both data and audio to be written using a single session. Likewise, DAO also allows both data and audio to be written on the same disc. Packet write allows only data to be written.
However, prior art optical recorders have a severe limitation when writing both audio and data modes to a CD when using either SAO or DAO formats. An encoder located in the optical recorder is not able to receive data from the computer in one mode while encoding data of another mode. To help illustrate this limitation, please refer to FIG. 1. FIG. 1 is a timing diagram showing tracks that will be written to a CD using different modes. The receiving process is begun at time t0 when information represented in first audio track 12 is continuously sent from the computer to a buffer on the optical recorder. Then, the optical recorder encodes information of the first audio track 12, and it will continue to record the information from the buffer to the disc.
Immediately following the first audio track 12 is a first data track 14. Since the first audio track 12 and the first data track 14 are not in the same mode, the optical recorder stops receiving and encoding information at time t1.
After the encoding process for the first audio track 12 is completed, and the buffer starts to receive and encode the first data track 14 from the computer. At time t2, the entire first data track 14 has been received. Even so, since a second audio track 16 follows the first data track 14, and the two modes are not identical, the encoder must finish encoding the first data track 14 before the second audio track 16 can be received.
Whenever the receiving process is temporarily stopped, there exists a possibility of buffer under-run. That is, if the recording process is faster than the encoding process, buffer under-run occurs and the compact disc is potentially ruined. Referring again to FIG. 1, at times t1 and t2 a potential for buffer under-run exists since at that time the buffer contains no information for recording about the next track.